package org.fnzn.access.dialect;

import org.fnzn.util.CommonUtil;

public final class AccessFacade {

    public static boolean hasPermission(final String p) {
        return CommonUtil.getUser() != null && CommonUtil.getUser().isPermitted(p);
    }

    public static boolean lacksPermission(final String p) {
        return !AccessFacade.hasPermission(p);
    }

    

    public static boolean hasRole(final String roleId) {
        return CommonUtil.getUser() != null && CommonUtil.getUser().hasRole(roleId);
    }

    public static boolean lacksRole(final String roleName) {
        return !AccessFacade.hasRole(roleName);
    }

}
